<template>
  <div></div>
</template>
<script setup>
var obj = {
  name: "张三",
  info: { age: 20 },
  getName: function () {
    console.log(this.name);
  },
};
function deepClone(obj) {
  if (typeof obj !== "object" || obj == null) {
    return obj;
  }
  let result;
  if (obj instanceof Array) {
    result = [];
  } else {
    result = {};
  }
  for (let key in obj) {
    if (obj.hasOwnProperty(key)) {
      result[key] = deepClone(obj[key]);
    }
  }
  return result;
}
console.log(789,obj);

</script>
<style lang='scss' scoped>
</style>